<?php

/**
 * Project: Espolon
 * Licence: BSD License
 * Link: http://espolon.org/
 * Copyright: Nicolas de Bari Embriz Garcia Rojas <nbari at espolon dot org>
 * Author: Nicolas de Bari Embriz Garcia Rojas <nbari at espolon dot org>
 * Version: Beta
 */


/*
 * if user not loged in then go to /users
 */
if (!sess_get('uid')) {
  header('Location: /user');
}
/**
 * Display active icon
 */
$tpl->assign('home', true);        

$command = (empty($options)) ? 'home' : $options[0];

switch ($command){
	case 'info': 
		$tpl->assign('tab2', true);
		$command_tpl = 'info.tpl';
		require_once 'info.php';
	break;
	case 'exit':
	  if (isset($options[1]) AND $options[1] == 'true') {  
      sign_out();
	  } else {
  	$command_tpl = 'exit.tpl';
	  $tpl->assign('tab3', true);
    }
	break;
	default:         
	  $tpl->assign('tab1', true);
    $command_tpl = 'home.tpl';
}
 
?>